package com.rbs.controller;

import com.rbs.service.BrandService;
import com.rbs.service.Impl.BrandServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

@WebServlet(urlPatterns = "/SelectAllBrandController")
public class SelectAllBrandController extends HttpServlet {
    private BrandService brandService = new BrandServiceImpl();
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Map<Integer, String> map = brandService.selectAllBrand();
        request.setAttribute("map",map);
        //转发到addPhone添加页面上
        request.getRequestDispatcher("/addPhone.jsp").forward(request,response);
    }
}
